<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Callback function - fullPage.js</title>
	<meta name="author" content="Alvaro Trigo Lopez" />
	<meta name="description" content="fullPage callback function." />
	<meta name="keywords"  content="fullpage,jquery,demo,callback,function,event" />
	<meta name="Resource-type" content="Document" />


	<link rel="stylesheet" type="text/css" href="../jquery.fullPage.css" />
	<link rel="stylesheet" type="text/css" href="examples.css" />

	<!--[if IE]>
		<script type="text/javascript">
			 var console = { log: function() {} };
		</script>
	<![endif]-->

	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
	<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>

	<script type="text/javascript" src="../jquery.fullPage.js"></script>
	<script type="text/javascript" src="examples.js"></script>
	<script type="text/javascript">
		var deleteLog = false;

		$(document).ready(function() {
			$('#fullpage').fullpage({
				sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE', 'whitesmoke', '#ccddff'],
				anchors: ['firstPage', 'secondPage', '3rdPage', '4thpage', 'lastPage'],
				menu: '#menu',
				onLeave: function(index, nextIndex, direction){
					if(deleteLog){
						$('#callbacksDiv').html('');
					}
					$('#callbacksDiv').append('<p>onLeave - index:' + index + ' nextIndex:' + nextIndex + ' direction:' + direction + '</p>')
					console.log("onLeave--" + "index: " + index + " nextIndex: " + nextIndex + " direction: " +  direction);
				},
				onSlideLeave: function(anchorLink, index, slideIndex, direction, nextSlideIndex){
					if(deleteLog){
						$('#callbacksDiv').html('');
					}
					$('#callbacksDiv').append('<p>onSlideLeave - anchorLink:' + anchorLink + " index:" + index + " slideIndex:" + slideIndex +" direction:" + direction + " nextSlideIndex:" + nextSlideIndex + '</p>');
					console.log("onSlideLeave--" + "anchorLink: " + anchorLink + " index: " + index + " slideIndex: " + slideIndex + " direction: " + direction);
				},
				afterRender: function(){
					$('#callbacksDiv').append('<p>afterRender</p>');
					console.log("afterRender");
				},
				afterResize: function(){
					$('#callbacksDiv').append('<p>afterResize</p>');
					console.log("afterResize");
				},
				afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex){
					$('#callbacksDiv').append('<p>afterSlideLoad - anchorLink:' + anchorLink + " index:" + index + " slideAnchor:" + slideAnchor +" slideIndex:" + slideIndex + '</p>');
					deleteLog = true;
					console.log("afterSlideLoad--" + "anchorLink: " + anchorLink + " index: " + index + " slideAnchor: " + slideAnchor + " slideIndex: " + slideIndex);
					console.log("----------------");
				},
				afterLoad: function(anchorLink, index){
                    console.log("after Load  " + index);
					$('#callbacksDiv').append('<p>afterLoad - anchorLink:' + anchorLink + " index:" + index + '</p>');
					deleteLog = true;
					console.log('===============');
					console.log("afterLoad--" + "anchorLink: " + anchorLink + " index: " + index );
				}
			});

		});
	</script>

</head>
<body>

<div style="position:fixed;top:50px;left:50px;color:white;z-index:999;" id="callbacksDiv"></div>


<ul id="menu">
	<li data-menuanchor="firstPage"><a href="#firstPage">First slide</a></li>
	<li data-menuanchor="secondPage"><a href="#secondPage">Second slide</a></li>
	<li data-menuanchor="3rdPage"><a href="#3rdPage">Third slide</a></li>
</ul>

<select id="demosMenu">
  <option selected>Choose Demo</option>
  <option id="activeSlide">Active section and slide</option>
  <option id="apple">Apple iPhone demo (animations)</option>
  <option id="autoHeight">Auto height</option>
  <option id="autoplayVideoAndAudio">Autoplay Video and Audio</option>
  <option id="backgrounds">Background images</option>
  <option id="backgroundsFixed">Fixed fullscreen backgrounds</option>
  <option id="backgroundVideo">Background video</option>
  <option id="callbacks">Callbacks</option>
  <option id="continuousHorizontal">Continuous horizontal</option>
  <option id="continuousVertical">Continuous vertical</option>
  <option id="parallax">Parallax</option>
  <option id="css3">CSS3</option>
  <option id="dragAndMove">Drag And Move</option>
  <option id="easing">Easing</option>
  <option id="fadingEffect">Fading Effect</option>
  <option id="fixedHeaders">Fixed headers</option>
  <option id="gradientBackgrounds">Gradient backgrounds</option>
  <option id="interlockedSlides">Interlocked Slides</option>
  <option id="looping">Looping</option>
  <option id="methods">Methods</option>
  <option id="navigationV">Vertical navigation dots</option>
  <option id="navigationH">Horizontal navigation dots</option>
  <option id="noAnchor">No anchor links</option>
  <option id="normalScroll">Normal scrolling</option>
  <option id="normalScrollElements">Normal scroll elements</option>
  <option id="offsetSections">Offset sections</option>
  <option id="oneSection">One single section</option>
  <option id="resetSliders">Reset sliders</option>
  <option id="responsiveAutoHeight">Responsive Auto Height</option>
  <option id="responsiveHeight">Responsive Height</option>
  <option id="responsiveWidth">Responsive Width</option>
  <option id="responsiveSlides">Responsive Slides</option>
  <option id="scrollBar">Scroll bar enabled</option>
  <option id="scrollHorizontally">Scroll horizontally</option>
  <option id="scrollOverflow">Scroll inside sections and slides</option>
  <option id="scrollOverflowReset">ScrollOverflow Reset</option>
  <option id="lazyLoad">Lazy load</option>
  <option id="scrollingSpeed">Scrolling speed</option>
</select>

<div id="fullpage">
	<div class="section " id="section0">
		<h1>fullPage.js</h1>
		<p>Callbacks!</p>
		<img src="imgs/fullPage.png" alt="fullPage" />
	</div>
	<div class="section" id="section1">
		<div class="slide">
			<div class="intro">
				<h1>Feel free</h1>
				<p>All the callbacks you need to do whatever you need.</p>
				<p>Just what you would expect.</p>
			</div>
		</div>
		<div class="slide">
			<h1>Slide 2</h1>
		</div>
	</div>
	<div class="section" id="section2">
		<div class="intro">
			<h1>Ideal for animations</h1>
			<p>Total control over your website.</p>
		</div>
	</div>
</div>


</body>
</html>
